x86/hvm: remove multiple open coded 'chunking' loops
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 9 Jul 2015 16:27:16 +0000 (18:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jul 2015 16:27:16 +0000 (18:27 +0200)
commitfa1253e675dfd41db54f1809dd8d63a72ad475ae
tree5bc1ae5a15bb94bd275b5c995a87461929a11a8b
parent8b3776abe6b2accf1ffea625843ad40cd42bab96
x86/hvm: remove multiple open coded 'chunking' loops

...in hvmemul_read/write()

Add hvmemul_phys_mmio_access() and hvmemul_linear_mmio_access() functions
to reduce code duplication.

NOTE: This patch also introduces a change in 'chunking' around a page
      boundary. Previously (for example) an 8 byte access at the last
      byte of a page would get carried out as 8 single-byte accesses.
      It will now be carried out as a single-byte access, followed by
      a 4-byte access, a 2-byte access and then another single-byte
      access.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c